package com.funkids.prxis.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.funkids.prxis.service.*;
import com.funkids.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;

public class BaseContoller {

    @Autowired
    HttpServletRequest req;

    @Autowired
    RedisUtils redisUtil;

    @Autowired
    ISysUserService sysUserService;

    @Autowired
    ISysRoleService sysRoleService;

    @Autowired
    ISysMenuService sysMenuService;

    @Autowired
    ISysUserRoleService sysUserRoleService;

    @Autowired
    ISysRoleMenuService sysRoleMenuService;

    @Autowired
    ISysGoodsService sysGoodsService;

    @Autowired
    ISysSeckillGoodsService sysSeckillGoodsService;

    @Autowired
    ISysSeckillOrderService sysSeckillOrderService;

    /**
     * 获取页面
     * @return
     */
    public Page getPage() {
        int current = ServletRequestUtils.getIntParameter(req, "current",1);
        int size = ServletRequestUtils.getIntParameter(req, "size", 10);
        System.out.println("current:"+current+" ;size:"+size);
        return new Page(current, size);
    }
}
